package com.hibernate.hrm.service.department;

import com.hibernate.hrm.entity.Department;
import com.hibernate.hrm.entity.User;
import com.hibernate.hrm.entity.dto.department.DepartmentAddChildDTO;
import com.hibernate.hrm.entity.dto.department.DepartmentAddDTO;
import com.hibernate.hrm.entity.dto.department.DepartmentDetailDTO;
import com.hibernate.hrm.entity.dto.department.DepartmentEditDTO;
import com.hibernate.hrm.entity.dto.employee.UserDTO;

import java.util.List;

public interface DepartmentService {
    List<Department> getCompleteDepartmentTree(User currentUser);
    Department toggleDepartmentStatus(Integer departmentId, User operator) throws Exception;

    void setDepartmentHead(Integer departmentId, Integer headId, User operator) throws Exception;
    List<UserDTO> findEligibleHeadCandidates(Integer departmentId);
    DepartmentDetailDTO getDepartmentDetail(Integer departmentId);

    Department getDepartmentForEdit(Integer departmentId);
    List<Department> getAvailableParentDepartments(Integer currentDepartmentId);
    void updateDepartment(Integer departmentId, DepartmentEditDTO editDTO, User operator);
    void addTopDepartment(DepartmentAddDTO addDTO, User operator);

    List<UserDTO> findEligibleDepartmentHeads();
    void addChildDepartment(Integer parentId, DepartmentAddChildDTO addDTO, User operator);

    void deleteDepartment(Integer departmentId, User operator) throws Exception;
}
